<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        * {
            margin: 0px;
            padding: 0px;
        }

        .box {
            margin: 100px auto;
            width: 400px;
            border: red solid 1px;
        }

        ul {
            width: 100%;
            list-style: none;
        }

        span {
            width: 100px;
            margin-left: 40px;
        }

        li {
            height: 40px;
            line-height: 40px;
            border-bottom: red solid 1px;
        }

        .last {
            border-bottom: 0px;
        }

        .jishu {
            background: #38B774;
        }

        .oushu {
            background: #5EFF5E;
        }

        .current {
            background: blue;
        }
    </style>
    <script>
        window.onload = function () {
            function $(div) {
                return document.getElementById(div);
            }

            var liSpan = document.getElementsByTagName("li");
            // alert(liSpan.length);

            for (var i = 0; i < liSpan.length; i++) {

                if (i % 2 == 0) {
                    //    偶数情况下
                    liSpan[i].className = "oushu";
                } else {
                    liSpan[i].className = "jishu";
                }
                liSpan[i].onmouseover = function () {

                    this.className = "current";
                };
                liSpan[i].onmouseout = function () {
                    //    移出去
                    // this.className = "";
                    for (var i = 0; i < liSpan.length; i++) {

                        if (i % 2 == 0) {
                            //    偶数情况下
                            liSpan[i].className = "oushu";
                        } else {
                            liSpan[i].className = "jishu";
                        }
                    }
                };

            }
        };


    </script>
</head>
<body>
<div class="box">
    <ul>
        <li class="">
            <span>上证指数</span>
            <span>3641</span>
            <span>10-5</span>
            <span>0.16%</span>
        </li>
        <li>
            <span>上证指数</span>
            <span>3641</span>
            <span>10-5</span>
            <span>0.16%</span>
        </li>
        <li>
            <span>上证指数</span>
            <span>3641</span>
            <span>10-5</span>
            <span>0.16%</span>
        </li>
        <li>
            <span>上证指数</span>
            <span>3641</span>
            <span>10-5</span>
            <span>0.16%</span>
        </li>
        <li>
            <span>上证指数</span>
            <span>3641</span>
            <span>10-5</span>
            <span>0.16%</span>
        </li>
        <li>
            <span>上证指数</span>
            <span>3641</span>
            <span>10-5</span>
            <span>0.16%</span>
        </li>
        <li>
            <span>上证指数</span>
            <span>3641</span>
            <span>10-5</span>
            <span>0.16%</span>
        </li>
        <li>
            <span>上证指数</span>
            <span>3641</span>
            <span>10-5</span>
            <span>0.16%</span>
        </li>
        <li>
            <span>上证指数</span>
            <span>3641</span>
            <span>10-5</span>
            <span>0.16%</span>
        </li>
        <li class="last">
            <span>上证指数</span>
            <span>3641</span>
            <span>10-5</span>
            <span>0.16%</span>
        </li>
    </ul>
</div>

</body>
</html>